<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        用户名<input type="text" @focus="onFocus" >
        密码： <input type="password"  @blur="onblur">
    </div>

    <script>
        new Vue({
            el: '#app',
            data() {
                return {
                }
            },
            methods: {
                onFocus() {
                console.log('获得焦点');   
             },
             onblur() {
                console.log('失去焦点');
             }
            }
        })
    </script>
</body>
</html>
